﻿using System.IO;
using System.Windows.Forms;

namespace HAOest.IO.FileMover
{
    public partial class Form1 : Form
    {
        public Form1(string[] args)
        {
            InitializeComponent();
            this.Visible = false;
            string fromPath = args[0];
            string toPath = args[1];
            foreach (FileInfo fileInfo in new DirectoryInfo(fromPath).GetFiles())
            {
                string newFilePath = toPath + "\\" + fileInfo.Name;
                if (File.Exists(newFilePath))
                {
                    File.Delete(newFilePath);
                }
                File.Move(fileInfo.FullName, newFilePath);
            }
            MessageBox.Show(args[2], "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
    }
}
